package dayOfyear;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int year = sc.nextInt();
        int month = sc.nextInt();
        int day = sc.nextInt();

        int[] days = {0, 31, 28, 31, 31, 31, 30, 31, 31, 30, 31, 30, 31};

        if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {
            System.out.println(year + "是闰年");
            days[2] = 29;
        } else {
            System.out.println("不是");
        }

        int dayOfyear = 0;
        for (int i = 0; i < month; i++) {
            dayOfyear += days[i];
        }
        dayOfyear += day;
        System.out.println(dayOfyear);
    }
}
